import axios from 'axios';
import showMessage from '../util/showMessage';

const ins = axios.create();//创建一个axios实例
ins.interceptors.response.use(function(resp){
    if(resp.data.code===0){
        //运行成功
        return resp.data.data;
    }
    //运行失败
    showMessage({
        content:resp.data.msg,
        type:'error'
    })
    return null;
})

export default ins;